// #############################################################################
// ZINDEX

// handle z-index mor easily
// DOCS: http://www.sitepoint.com/better-solution-managing-z-index-sass/

@function map-has-nested-keys($map, $keys...) {
    @each $key in $keys {
        @if not map-has-key($map, $key) {
            @return false;
        }
        $map: map-get($map, $key);
    }

    @return true;
}
@function map-deep-get($map, $keys...) {
    @each $key in $keys {
        $map: map-get($map, $key);
    }

    @return $map;
}
@function z($layers...) {
    @if not map-has-nested-keys($z-layers, $layers...) {
        @error "No layer found for `#{inspect($layers...)}`
                in $z-layers map. Property omitted.";
    }

    @return map-deep-get($z-layers, $layers...);
}
